{% load pagebase %}
{% spaceless %}    
    {% ifequal page_index 1 %}
    	<span>首页</span>
    {% else %}
    	<a href="{{ page_url|cut:"%s/" }}" class="first">首页</a>
    {% endifequal %}
   
    {% if has_prev %}
		{% ifequal 1 page_prev %}
        	<a href="{{ page_url|cut:"%s/" }}" class="prev">上一页</a>
        {% else %}
			<a href="{{ page_prev|format:page_url }}" class="prev">上一页</a>
		{% endifequal %}		
    {% else %}
    <span>上一页</span>
    {% endif %}    

	{% for p in page_nums %}
		{% ifequal p page_index %}
			<span class="current">{{ p }}</span>
		{% else %}
			{% ifequal p 1 %}			
	    		<a href="{{ page_url|cut:"%s/" }}">{{ p }}</a>
			{% else %}
				<a href="{{ p|format:page_url }}">{{ p }}</a>
			{% endifequal %}			
		{% endifequal %}
	{% endfor %}
    
	{% if has_next %}
    	<a href="{{ page_next|format:page_url }}" class="next">下一页</a>
    {% else %}
    	<span>下一页</span>
    {% endif %}
    {% ifequal page_index page_count %}
        尾页
    {% else %}
    	<a href="{{ page_count|format:page_url }}" class="last">尾页</a>
    {% endifequal %}
	
    <span class="tip">共 {{ row_count }} 篇文章</span>
{% endspaceless %}